//
//  UtilsCell.m
//  RainbowFM
//
//  Created by chenli on 14/12/10.
//  Copyright (c) 2014年 RB. All rights reserved.
//

#import "UtilsCell.h"
#import "OrderModel.h"

@implementation UtilsCell

@end


@implementation ActivityListCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}

@end

@implementation ActivityDetailCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}

@end


@implementation AnswerCollectionCell


@end


@implementation StockListCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}

@end

@implementation ADCollectionCell


@end


@interface OrderListCell(){
    NSInteger orderStatus;
}

@end

@implementation OrderListCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}

-(void)cellStatus:(OrderListItem *)orderItem{
    
    self.confirmButton.hidden = NO;
    self.cancelButton.hidden = NO;
    switch ([orderItem.orderStatus integerValue]) {
        case 1:
            self.statusLabel.text = @"待付款";
            [self.confirmButton setTitle:@"付款" forState:UIControlStateNormal];
            [self.cancelButton setTitle:@"取消订单" forState:UIControlStateNormal];
            break;
        case 2:
            self.statusLabel.text = @"已过期";
            self.confirmButton.hidden = YES;
            self.cancelButton.hidden = YES;
            break;
        case 3:
            
            break;
        case 4:
            orderStatus = 4;
            self.cancelButton.hidden = YES;
            self.statusLabel.text = @"等待发货";
            [self.confirmButton setTitle:@"退款" forState:UIControlStateNormal];
            break;
        case 5:
            self.statusLabel.text = @"已发货";
            [self.confirmButton setTitle:@"确认收货" forState:UIControlStateNormal];
            [self.cancelButton setTitle:@"延迟收货" forState:UIControlStateNormal];
            if ([orderItem.delayStatus integerValue] == 1) {
                self.cancelButton.hidden = YES;
            }
            break;
        case 6:
            
            break;
        case 7:
            self.statusLabel.text = @"交易完成";
            [self.confirmButton setTitle:@"申请退货" forState:UIControlStateNormal];
            self.cancelButton.hidden = YES;
            break;
        case 8:
            self.cancelButton.hidden = YES;
            self.confirmButton.hidden = YES;
            self.statusLabel.text = @"已退款,交易完成";
            
            break;
        default:
            break;
    }
    
    switch ([orderItem.refundStatus integerValue]) {
        case 1:
            self.confirmButton.hidden = YES;
            self.cancelButton.hidden = YES;
            self.statusLabel.text = @"已申请退款";
            break;
        case 2:
            if (orderStatus == 4) {
                self.statusLabel.text = @"拒绝退款";
                self.confirmButton.hidden = YES;
                self.cancelButton.hidden = YES;
            }
            
            break;
        case 3:
            
            break;
        case 4:
            //            self.cancelButton.hidden = NO;
            //            self.statusLabel.text = @"等待发货";
            //            self.confirmButton.hidden = YES;
            //            [self.cancelButton setTitle:@"退款" forState:UIControlStateNormal];
            break;
        case 5:
            //            self.cancelButton.hidden = NO;
            //            self.statusLabel.text = @"已发货";
            //            self.confirmButton.hidden = YES;
            //            [self.cancelButton setTitle:@"延迟收货" forState:UIControlStateNormal];
            break;
        case 6:
            
            break;
        case 7:
            //            self.cancelButton.hidden = YES;
            //            self.statusLabel.text = @"交易完成";
            //            self.confirmButton.hidden = YES;
            break;
        case 8:
            //            self.cancelButton.hidden = YES;
            //            self.statusLabel.text = @"已退款,交易完成";
            //            self.confirmButton.hidden = YES;
            break;
        default:
            break;
    }
    
}

-(void)orderStatus:(NSInteger)status{
    
}


-(void)refundStatus:(NSInteger)status{

    
}

@end


@implementation MallCollectionCell


@end

@implementation CompShowCell

-(void)showType:(NSString *)type{
    if ([type isEqualToString:@"image"]) {
        self.playButton.hidden = YES;
    }else{
        self.playButton.hidden = NO;
    }
}

@end